A WiFi (Wireless Fidelity) standard IEEE 802.11 defines a fine time measurement (FTM) process between two wireless communication nodes, as shown in FIG. 1A. A first FTM measurement process in a burst period is used as an example. The FTM process is specifically as follows: After a requester, for example, a station (STA) (which is usually a terminal device such as a mobile phone), sends an FTM measurement request to a responder, for example, an access point (AP), the responder responds to the requester, sends a measurement frame FTM_1 to the responder, and records a sending time t1_1 of the measurement frame FTM_1. Correspondingly, the requester receives the measurement frame FTM_1 and records a receiving time t2_1 of the measurement frame FTM_1. After receiving the measurement frame FTM_1, the requester waits for a fixed time, a short interframe spacing (SIFS), according to IEEE 802.11; then sends an acknowledgement (ACK) frame to the responder; and records a sending time t3_1 of the acknowledgement frame. Correspondingly, the responder receives the acknowledgement frame and records a receiving time t4_1. As shown in FIG. 1A, the responder sends a captured time stamp (t1_1, t4_1) to the requester in a next FTM measurement frame FTM_2, so that the requester may calculate a distance between the requester and the responder based on the times t1_1, t2_1, t3_1, and t4_1.
It can be learned by referring to IEEE 802.11 that a time of a one-way flight (ToF) of a message (the measurement frame or the acknowledgement frame) between the access point and the station is equal to [(t4−t1)−(t3−t2)]/2. In this case, the station may calculate the distance r between the access point and the station based on the following formula: r=C×[t4−t1)−(t3−t2)]÷2, where C is a speed of light.
A relatively typical positioning method used in the prior art is trilateration. As shown in FIG. 2, on one plane, locations of three APs (an AP1, an AP2, and an AP3 that are not in a straight line) are known to a STA. The STA is located on a circumference of a circle that is centered at the location of each AP and whose radius is a distance from the STA to the AP. A point of intersection of three circles is a location of the STA.
Mathematical formulas of trilateration are as follows:
  {                                                                                                              (                                                                  x                                                  AP                          ⁢                                                                                                          ⁢                          1                                                                    -                      x                                        )                                    2                                +                                                      (                                                                  y                                                  AP                          ⁢                                                                                                          ⁢                          1                                                                    -                      y                                        )                                    2                                                      =                          r              1                                                                                                                                            (                                                                  x                                                  AP                          ⁢                                                                                                          ⁢                          2                                                                    -                      x                                        )                                    2                                +                                                      (                                                                  y                                                  AP                          ⁢                                                                                                          ⁢                          2                                                                    -                      y                                        )                                    2                                                      =                          r              2                                                                                                                                            (                                                                  x                                                  AP                          ⁢                                                                                                          ⁢                          3                                                                    -                      x                                        )                                    2                                +                                                      (                                                                  y                                                  AP                          ⁢                                                                                                          ⁢                          3                                                                    -                      y                                        )                                                        2                    ⁢                                                                                                                                      =                          r                              3                ⁢                                                                                                            ,  where
r1, r2, and r3 each may be obtained by multiplying a ToF between each AP and the STA by the speed of light. It can be seen from the foregoing formulas that the STA may calculate the location of the STA based on the three APPs whose locations are known and a time of flight of a message from the STA to each of the three APs. The foregoing positioning method may also be extended to three-dimensional (3D) space. During positioning in the three-dimensional space, a formula for calculating a distance between the STA and an additional AP further needs to be obtained. To be specific, the STA requires at least four APs (which are not located on one plane) for positioning the location of the STA.
For APs in FIG. 1B, using an AP1 as an example, the AP1 already knows a location (xAP1·yAP1) of the AP1, t1, and t4. Although a STA does not notify t2 and t3 to the AP1, it can be seen from the foregoing calculation process that the AP1 can calculate a distance from the STA to the AP1 provided that the AP1 knows (t3−t2).
It can be learned by referring to FIG. 1C that a SIFS is a time from an end of a last symbol in a current frame (for example, a measurement frame) to a start of a first symbol in a preamble sequence of a next frame (for example, an ACK frame). For a STA, an end moment of a last symbol of the measurement frame is a moment at which the STA finishes receiving the measurement frame. It can be seen from FIG. 1C that t2 is a time at which the STA receives a first symbol of the measurement frame, t3 is a time at which the SA sends the first symbol of the measurement frame, and (t3−t2) is actually equal to a length of a SIFS+a frame length Length of the measurement frame. The AP already knows the frame length Length of the measurement frame and the SIFS stipulated in the IEEE 802.11 standard. Therefore, for the AP, (t3−t2) is also a known value actually. There is a specific deviation between a SIFS value actually used by the STA and a SIFS value stipulated in the standard (a deviation within a specific range is allowed for the SIFS value stipulated in the standard). However, the SIFS value actually used by the STA is also a fixed value. Therefore, (t3−t2) is also a constant value.
In this way, an AP1 can calculate a location of the STA according to the trilateration by further obtaining only respective locations of an AP2 and an AP3, frame lengths of measurement frames respectively sent by the AP2 and the AP3, and time stamps t1 and t4; and the AP1 may further calculate the SIFS value actually used by the STA. This is also applicable to the AP2 and the AP3. The location of the STA can be calculated by obtaining only locations of the other two APs, frame lengths of measurement frames sent by the other two APs, and time stamps t1 and t4. As a result, the location of the STA is transparent to an AP or a positioning system in which an AP is located. This is disadvantageous to protection of location privacy of the STA.